﻿<%@ Page Language="c#" CodeBehind="ReadMail.aspx.cs" AutoEventWireup="false" Inherits="UDS.SubModule.UnitiveDocument.Mail.ReadMailPage" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
  <title>ReadMail Page</title>
  <uds:Style runat="server" Href="~/css/BasicLayout.css" />
  <script type="text/javascript">
  //<!--
  function downloadfile(destFile) {
    self.location = "Download.aspx?destFileName=" + destFile;
  }

  function Incoming(a) {
    var ret;
    ret = window.showModalDialog("TreeView.aspx", window, "dialogHeight:400px;dialogWidth:300px;center:Yes;Help:No;Resizable:No;Status:Yes;Scroll:auto;Status:no;");
    if (ret > 0)
      return false;
  }
  //-->
  </script>
</head>
<body>
  <form id="ReadMail" method="post" runat="server">
  <uds:PageTitle runat="server" Title="阅读邮件" HintImage="~/images/283.GIF" />
  <table class="fixedTable borderTable" style="width: 100%;">
    <colgroup>
      <col style="width: 100px; text-align: right;" />
      <col style="width: 100%;" />
    </colgroup>
    <tr>
      <td>
        发送人
      </td>
      <td>
        <%= HttpUtility.HtmlEncode(MailContent.SenderRealName) %>
      </td>
    </tr>
    <tr>
      <td>
        收件人
      </td>
      <td>
        <%= HttpUtility.HtmlEncode(MailContent.TOList_RealName) %>
      </td>
    </tr>
    <tr>
      <td>
        抄送人
      </td>
      <td>
        <%= HttpUtility.HtmlEncode(MailContent.CCList_RealName) %>
      </td>
    </tr>
    <tr>
      <td>
        所属项目
      </td>
      <td>
        <%= HttpUtility.HtmlEncode(MailContent.ClassName) %>
      </td>
    </tr>
    <tr>
      <td>
        邮件标题
      </td>
      <td>
        <%= (MailContent.Importance == MailImportance.Normal) ? string.Empty : string.Format("<span style=\"color:red;\">[{0}]</span> ", Utility.GetEnumDisplayName(MailContent.Importance)) %>
        <%= HttpUtility.HtmlEncode(MailContent.Subject) %>
      </td>
    </tr>
    <tr>
      <td>
        发送时间
      </td>
      <td>
        <%= Utility.FormatDateTime(MailContent.TimeSent) %>
      </td>
    </tr>
    <tr>
      <td>
        邮件内容
      </td>
      <td>
        <%= MailContent.Body %>
      </td>
    </tr>
    <tr runat="server" id="attachmentsRow">
      <td valign="middle" style="vertical-align: middle;">
        附件
      </td>
      <td>
        <asp:Repeater runat="server" ID="attachmentRepeater" EnableViewState="false">
          <HeaderTemplate>
            <table border="0" class="padding_table">
          </HeaderTemplate>
          <ItemTemplate>
            <tr>
              <td>
                <a href="Download.aspx?FileID=<%# ((MailAttachmentInfo)Container.DataItem).ID %>" target="_blank">
                  <%# HttpUtility.HtmlEncode(((MailAttachmentInfo)Container.DataItem).FileName)%>
                </a>
              </td>
            </tr>
          </ItemTemplate>
          <FooterTemplate>
            </table>
          </FooterTemplate>
        </asp:Repeater>
      </td>
    </tr>
    <tr>
      <td>
        &nbsp;
      </td>
      <td>
        <p>
          <uds:RedirectButton runat="server" ID="btnReply" CssClass="ButtonCss" Text="回 复" />
          <uds:RedirectButton runat="server" ID="btnForward" CssClass="ButtonCss" Text="转 发" />
          <uds:RedirectButton runat="server" ID="btnBack" CssClass="ButtonCss" Text="返 回" />
          <asp:Button ID="btnDelete" runat="server" CssClass="ButtonCss" Text="删 除" OnClientClick="javascript:return confirm('您确认要删除此邮件吗?');" />
          <%--
          TODO: 
          <input class="ButtonCss" onclick="Incoming()" type="button" value="归档" />
          --%>
        </p>
      </td>
    </tr>
  </table>
  </form>
</body>
</html>
